//
//  OrderObject.h
//  PurchasingMeeting
//
//  Created by zhuang yihang on 7/10/13.
//  Copyright (c) 2013 YX. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "ProductObject.h"
/*
 该类定义了每条订单信息
 */

typedef enum {
    eOrderStatus_Waiting,//等待上传
    eOrderStatus_Success,//已提交到服务器
}eOrderStatus;

@interface OrderObject : NSObject

@property (nonatomic, strong) NSString* pColorCode;
@property (nonatomic, strong) NSString *pCode;
@property (nonatomic, assign) eOrderStatus oStatus;
@property (nonatomic, strong) NSMutableDictionary *quantity;

//order所关联控件
@property (nonatomic, strong) NSMutableDictionary* pParam;

- (id)initWithProduct:(ProductObject *)product;

//设置订单数量
- (void)setOrder:(NSString *)sizeNo withQuantity:(int)quantity withShopID:(NSString *)shopID;
//与控件绑定
- (void)setOrderControl:(NSString *)sizeNo withShopID:(NSString *)shopID view:(UIView *)view;
//获取不同尺码，不同店铺的订单数量
- (int)getOrder:(NSString *)sizeNo withShopID:(NSString *)shopid;

//根据字典数据初始化，字典的结构参考transToDictionary函数
- (void)initializeFromDictionary:(NSDictionary *)dictionary;
//返回相应字典
- (NSDictionary *)transToDictionary;

//返回总订货数
- (int)getTotalOrderNumber;

- (int)getOrderNumberInShop:(NSString *)shopID;

- (int)getOrderNumberBySeries:(NSString *)pSeries inShop:(NSString *)shop;

- (int)getOrderNumberBySize:(NSArray *)array;

-(void)clearOrder;
- (void)clearOrderBySize:(NSArray *)array;

-(void)clearkey:(NSString *)key;

@end
